package com.shenxuchen.crm.mapper;

import com.shenxuchen.crm.pojo.Type;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface TypeMapper {
    @Select("select * from tbl_dictionary_type")
    List<Type> getAll();

    @Insert("insert into tbl_dictionary_type values(#{code},#{name},#{description})")
    void save(Type type);

    @Select("select * from tbl_dictionary_type where code=#{code}")
    Type getByCode(String code);

    @Update("update tbl_dictionary_type set name=#{name},description=#{description} where code=#{code}")
    void edit(Type type);

    void delete(String[] codes);
}
